package com.rtos.model.cpu.registers;

import lombok.Data;

/**
 * @Author: biubiu0002
 * @Date: 2021-08-30 23:08
 * 程序计数器
 * 饿汉式单例
 **/
@Data
public class PC extends AbstractRegister {
    private PC(){
        buffer=0;
    }
    private static PC pc;

    public static PC getInstance(){
        if(pc==null){
            pc = new PC();
        }
        return pc;
    }

    public void plus(){
        this.setBuffer(getBuffer()+1);
    }
}
